package com.example.gaoyang.enums;

public enum JointCarTypeEnum {
    // 巡逻车
    PATROL_CAR("1", "巡逻车"),
    // 施救车
    RESCUE_CAR("2", "施救车"),
    // 巡查车
    PATROL_INSPECTION_CAR("3", "巡查车"),
    // 交警车
    POLICE_CAR("4", "交警车"),
    // 施工车
    CONSTRUCTION_CAR("5", "施工车"),
    ;

    private final String type;
    private final String name;

    JointCarTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static String getNameByType(String type) {
        for (JointCarTypeEnum jointCarTypeEnum : JointCarTypeEnum.values()) {
            if (jointCarTypeEnum.getType().equals(type)) {
                return jointCarTypeEnum.getName();
            }
        }
        return null;
    }
}
